package org.wu.framework.authorization.platform.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;
import org.wu.framework.authorization.platform.application.SysZoneApplicationApplication;
import org.wu.framework.authorization.platform.application.command.sys.zone.application.*;
import org.wu.framework.authorization.platform.application.dto.SysZoneApplicationDTO;
import org.wu.framework.authorization.platform.domain.model.sys.zone.application.SysZoneApplication;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.spring.EasyController;

import java.util.List;
/**
 * describe 应用信息 
 *
 * @author Jia wei Wu
 * @date 2024/04/02 06:21 晚上
 * @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyController 
 **/
@Tag(name = "应用信息提供者")
@EasyController("/lazy/zone/application")
public class SysZoneApplicationProvider  {

    @Resource
    private SysZoneApplicationApplication sysZoneApplicationApplication;

    /**
     * describe 新增应用信息
     *
     * @param sysZoneApplicationStoryCommand 新增应用信息
     * @return {@link Result< SysZoneApplication >} 应用信息新增后领域对象
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "新增应用信息")
    @PostMapping("/story")
    public Result<SysZoneApplication> story(@RequestBody SysZoneApplicationStoryCommand sysZoneApplicationStoryCommand){
        return sysZoneApplicationApplication.story(sysZoneApplicationStoryCommand);
    }
    /**
     * describe 批量新增应用信息
     *
     * @param sysZoneApplicationStoryCommandList 批量新增应用信息
     * @return {@link Result<List< SysZoneApplication >>} 应用信息新增后领域对象集合
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "批量新增应用信息")
    @PostMapping("/batchStory")
    public Result<List<SysZoneApplication>> batchStory(@RequestBody List<SysZoneApplicationStoryCommand> sysZoneApplicationStoryCommandList){
        return sysZoneApplicationApplication.batchStory(sysZoneApplicationStoryCommandList);
    }
    /**
     * describe 更新应用信息
     *
     * @param sysZoneApplicationUpdateCommand 更新应用信息
     * @return {@link Result< SysZoneApplication >} 应用信息领域对象
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "更新应用信息")
    @PutMapping("/updateOne")
    public Result<SysZoneApplication> updateOne(@RequestBody SysZoneApplicationUpdateCommand sysZoneApplicationUpdateCommand){
        return sysZoneApplicationApplication.updateOne(sysZoneApplicationUpdateCommand);
    }
    /**
     * describe 查询单个应用信息
     *
     * @param sysZoneApplicationQueryOneCommand 查询单个应用信息
     * @return {@link Result< SysZoneApplicationDTO >} 应用信息DTO对象
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "查询单个应用信息")
    @GetMapping("/findOne")
    public Result<SysZoneApplicationDTO> findOne(@ModelAttribute SysZoneApplicationQueryOneCommand sysZoneApplicationQueryOneCommand){
        return sysZoneApplicationApplication.findOne(sysZoneApplicationQueryOneCommand);
    }
    /**
     * describe 查询多个应用信息
     *
     * @param sysZoneApplicationQueryListCommand 查询多个应用信息
     * @return {@link Result<List< SysZoneApplicationDTO >>} 应用信息DTO对象
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "查询多个应用信息")
    @GetMapping("/findList")
    public Result<List<SysZoneApplicationDTO>> findList(@ModelAttribute SysZoneApplicationQueryListCommand sysZoneApplicationQueryListCommand){
        return sysZoneApplicationApplication.findList(sysZoneApplicationQueryListCommand);
    }
    /**
     * describe 分页查询多个应用信息
     *
     * @param sysZoneApplicationQueryListCommand 分页查询多个应用信息
     * @return {@link Result<LazyPage< SysZoneApplicationDTO >>} 分页应用信息DTO对象
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "分页查询多个应用信息")
    @GetMapping("/findPage")
    public Result<LazyPage<SysZoneApplicationDTO>> findPage(@Parameter(description ="分页大小") @RequestParam(defaultValue = "10", value = "size") int size,
                                                            @Parameter(description ="当前页数") @RequestParam(defaultValue = "1", value = "current") int current, @ModelAttribute SysZoneApplicationQueryListCommand sysZoneApplicationQueryListCommand){
        return sysZoneApplicationApplication.findPage(size,current, sysZoneApplicationQueryListCommand);
    }
    /**
     * describe 删除应用信息
     *
     * @param sysZoneApplicationRemoveCommand 删除应用信息
     * @return {@link Result< SysZoneApplication >} 应用信息
     
     * @author Jia wei Wu
     * @date 2024/04/02 06:21 晚上
     **/

    @Operation(summary = "删除应用信息")
    @DeleteMapping("/remove")
    public Result<SysZoneApplication> remove(@ModelAttribute SysZoneApplicationRemoveCommand sysZoneApplicationRemoveCommand){
        return sysZoneApplicationApplication.remove(sysZoneApplicationRemoveCommand);
    }
}